package se.mbaeumer.regexhelper;

public class RegExpHelper {
	public static final String PLAIN_ALPHABETS = "[a-zA-Z]";
	public static final String ALPHABETS_UPPER_CASE = "[A-Z]";
	public static final String ALPHABETS_LOWER_CASE = "[a-z]";
	public static final String PLAIN_ALPHANUMERICS ="[a-zA-Z0-9]";
	public static final String PLAIN_NUMERALS ="[0-9]";
	/*
	 * Returns a regex for an email-address
	 */
	public static final String EMAIL ="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}";
	
	/**
	 * Returns a regex for a password
	 */
	public static final String PASSWORD ="((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})";
	/**
	 * Names usually start with an upper case letter.
	 */
	public static final String NAME ="^[A-Z][a-z].*";
	
	/**
	 * Returns a regex for a limited number of alphabets
	 */
	public String getLimitedAlphabets(int limit){
		return PLAIN_ALPHABETS + "{" + limit + "}";
	}
	
	/**
	 * Returns a regex for a limited number of alphabets
	 */
	public String getLimitedAlphanbets(int lower, int upper){
		return PLAIN_ALPHABETS + "{" + lower + "," + upper +")";
	}
	
	/**
	 * Returns a regex for a limited number of alpha-numerics
	 */
	public String getLimitedAlphanumerics(int limit){
		return PLAIN_ALPHANUMERICS + "{" + limit + "}";
	}
	
	/**
	 * Returns a regex for a limited number of alpha-numerics
	 */
	public String getLimitedAlphanumerics(int lower, int upper){
		return PLAIN_ALPHANUMERICS + "{" + lower + "," + upper +")";
	}
	
	/**
	 * Returns a regex for a limited number of numerals
	 */
	public String getLimitedNumerals(int limit){
		return PLAIN_NUMERALS + "{" + limit + "}";
	}
	
	/**
	 * Returns a regex for a limited number of numerals
	 */
	public String getLimitedNumerals(int lower, int upper){
		return PLAIN_NUMERALS + "{" + lower + "," + upper +")";
	}
}
